package com.niuke;

import java.util.Scanner;

/**
 * 57. 最长方连续方波信号
 * https://zhuanlan.zhihu.com/p/645264474
 */
public class NiukeMoni57 {

    public static void main(String[] args) {

        Scanner scanner = new Scanner(System.in);
        String input = scanner.nextLine();

        String result = "";
        int startIndex = input.indexOf("0");
        boolean isGood = true;
        for (int i = startIndex + 1; i < input.length(); i++) {

            if (input.charAt(i) == '0' && (input.charAt(i - 1) == '0' || i == input.length() - 1)) {
                if (isGood) {
                    String tempResult;
                    if (i == input.length() - 1) {
                        tempResult = input.substring(startIndex);
                    } else {
                        tempResult = input.substring(startIndex, i);
                    }
                    if (tempResult.length() >= 3 && tempResult.length() > result.length()) {
                        result = tempResult;
                    }
                }
                startIndex = i;
                isGood = true;
            } else if (input.charAt(i) == '1' && input.charAt(i - 1) == '1') {
                isGood = false;
            }
        }

        System.out.println(result);

    }

}
